//
//  PushViewManager.m
//  YJAPPThird
//
//  Created by 张吉旭 on 16/12/22.
//  Copyright © 2016年 yj. All rights reserved.
//

#import "PushViewManager.h"
#import "JPUSHService.h"
//#import "UpgradeViewController.h"
//#import "YJAskDetailViewController.h"
//#import "YJSessionListViewController.h"
//#import "YJSessionViewController.h"
//#import "YJActionWebViewController.h"
//#import "YJStudyDetailViewController.h"

#import <XHLaunchAd.h>

static PushViewManager * instance = nil;


@implementation PushViewManager


+(PushViewManager*)shareInstance{
    static dispatch_once_t onceToken;
    
    dispatch_once(&onceToken, ^{
        instance = [[PushViewManager alloc] init];
    });
    
    return instance;
}



- (void)respondDelayPush{

    if(_pushActionDic){
        [self pushViewByUserInfo:_pushActionDic];
    }
}


-(void)pushViewByUserInfo:(NSDictionary *)userInfo{
    
  
    

    
//    UITabBarController *tabVC = [AppDelegate appDelegate].mainTab;
//    UINavigationController *nv = tabVC.selectedViewController;
    
    
    
//    if(!pushType){//聊天
//        NSString *sessionId   = userInfo[@"sessionId"];
//        NSString *sessionType = userInfo[@"sessionType"];
//        if(!sessionId){
//            _pushActionDic = nil;
//            return;
//        }
//
//        if(sessionType && [sessionType isEqualToString:@"NIMSessionTypeP2P"]){
//            NIMSession *session = [NIMSession session:sessionId type:NIMSessionTypeP2P];
//            YJSessionViewController *sessionVC = [[YJSessionViewController alloc] initWithSession:session];
//            [nv pushViewController:sessionVC animated:YES];
//            _pushActionDic = nil;
//            return;
//        }
//        if(sessionType && [sessionType isEqualToString:@"NIMSessionTypeTeam"]){
//            NIMSession *session = [NIMSession session:sessionId type:NIMSessionTypeTeam];
//            YJSessionViewController *sessionVC = [[YJSessionViewController alloc] initWithSession:session];
//            [nv pushViewController:sessionVC animated:YES];
//            _pushActionDic = nil;
//            return;
//
//        }
//
//        NIMSession *session = [NIMSession session:sessionId type:NIMSessionTypeP2P];
//        YJSessionViewController *sessionVC = [[YJSessionViewController alloc] initWithSession:session];
//        [nv pushViewController:sessionVC animated:YES];
//        _pushActionDic = nil;
//        return;
//    }
//    if([pushType isEqualToString:@"Member"]){
//
//        UpgradeViewController *upgradeVC = [[UpgradeViewController alloc] init];
//        [nv pushViewController:upgradeVC animated:YES];
//        _pushActionDic = nil;
//        return;
//    }
//
//    if([pushType isEqualToString:@"AskReply"]){
//
//        NSString *askId = userInfo[@"AskId"];
//        YJAskDetailViewController *askDeatilVC = [[YJAskDetailViewController alloc] initWithAskId:askId];
//        [nv pushViewController:askDeatilVC animated:YES];
//        _pushActionDic = nil;
//        return;
//    }
//
//    
//    if([pushType isEqualToString:@"Activity"]){
//
//        NSString *webUrl = userInfo[@"webUrl"];
//        YJActionWebViewController *webViewVC = [[YJActionWebViewController alloc] initWithWebUrl:webUrl];
//        [nv pushViewController:webViewVC animated:YES];
//        _pushActionDic = nil;
//        return;
//    }
//    if([pushType isEqualToString:@"Course"]){
//
//        NSString *courseId = userInfo[@"courseId"];
//        YJStudyDetailViewController *studyDetailVC = [[YJStudyDetailViewController alloc] init];
//        studyDetailVC.courseId = courseId;
//        studyDetailVC.isRecord = NO;
//        [nv pushViewController:studyDetailVC animated:YES];
//        _pushActionDic = nil;
//        return;
//    }

    
    
}

@end
